/**
 * @file   colorRule.h
 * @author wolfhead <wolfhead@wolfhead-laptop>
 * @date   Mon Dec  5 20:32:29 2011
 * 
 * @brief  
 * 
 * 
 */
#ifndef ACAPELLA_COLORLINE_COLOR_RULE_H
#define ACAPELLA_COLORLINE_COLOR_RULE_H

#include <string>

class ColorConfig;
class ColorRule;

class ColorRule
{
public:
    virtual ~ColorRule(){};

    int Create(
        const ColorConfig * pColorConfig,
        const std::string& param, 
        const std::string& color);

    bool Match(
        const std::string& line);

    const std::string& GetColor();

protected:

    virtual int _Create(const std::string& param) = 0;
    
    virtual bool _Match(const std::string& line) = 0;

    int _SetColor(
        const ColorConfig * pColorConfig,
        const std::string& color);
    
    std::string color_;
};

class ColorRuleFactory
{
public:
    static ColorRule* CreateColorRule(
        const ColorConfig * pColorConfig,
        const std::string& type,
        const std::string& param,
        const std::string& color);
};


#endif // ifndef ACAPELLA_COLORLINE_COLOR_RULE_H
